package com.winenine999.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.winenine999.custom.dao.CWineproductMapper;
import com.winenine999.generator.dao.WineproductMapper;
import com.winenine999.jdbc.dao.WinebrandDao;
import com.winenine999.jdbc.dao.WineproductDao;
import com.winenine999.model.Page;
import com.winenine999.model.Wineproduct;
import com.winenine999.service.IWineproductService;
@Service
public class WineproductService implements IWineproductService {
	@Autowired
	private WineproductMapper wineproductMapper;
	@Autowired
	private CWineproductMapper cWineproductMapper;

	/**
	 * jdbc.dao
	 * 分页查询用的原始dao
	 */
	@Autowired
	private WineproductDao wineproductDao;
	
	/**
	 * 根据id删除wineproduct
	 */
	@Override
	public int deleteByPrimaryKey(Integer id) {
	
		return wineproductMapper.deleteByPrimaryKey(id);
	}
	/**
	 * 选择字段添加wineproduct
	 */
	@Override
	public int insertSelective(Wineproduct wineproduct) {
		
		return wineproductMapper.insertSelective(wineproduct);
	}
	/**
	 * 根据id查询wineproduct
	 */
	@Override
	public Wineproduct selectByPrimaryKey(Integer id) {
		
		return wineproductMapper.selectByPrimaryKey(id);
	}
	/**
	 * 选择字段修改wineproduct
	 */
	@Override
	public int updateByPrimaryKeySelective(Wineproduct wineproduct) {
		
		return wineproductMapper.updateByPrimaryKeySelective(wineproduct);
	}
	//---------------------------------------------------------------------
	/**
	 * 分页查询，传入的page有startIndex,pageSize
	 * 
	 */
	@Override
	public Page findPageWineproducts(Page page) {
		
		return wineproductDao.findPageWineproducts(page);
	}
	/**
	 * 分页查询wineproduct,winebrand,winetype,winery
	 */
	@Override
	public Page findPageAllWineproductsInfo(Page page) {
		
		return wineproductDao.findPageAllWineproductsInfo(page);
	}
	/**
	 * 查询全部wineproducts
	 */
	@Override
	public List<Map<String, Object>> selectAllWineProducts() {
		
		return cWineproductMapper.selectAllWineProducts();
	}
	/**
	 * 查询 id不在list中的所有酒产品
	 */
	@Override
	public List<Map<String, Object>> selectWineProductsByIds(List list) {
		
		return cWineproductMapper.selectWineProductsByIds(list);
	}


}
